LanguageExt.Core

LanguageExt.Core Concurrency ValueTask

Contents

class ValueTaskExtensions Source #

Methods

method bool CompletedSuccessfully <A> (this ValueTask<A> ma) Source #

method ValueTask<A> AsFailedValueTask <A> (this Exception ex) Source #

method ValueTask<A> AsValueTask <A> (this A self) Source #

Convert a value to a Task that completes immediately

method ValueTask<A> ToValue <A> (this Task<A> self) Source #

Convert a Task to a ValueTask

method ValueTask<A> Flatten <A> (this ValueTask<ValueTask<A>> self) Source #

Flatten the nested Task type

method ValueTask<A> Flatten <A> (this ValueTask<ValueTask<ValueTask<A>>> self) Source #

Flatten the nested Task type

method ValueTask<U> Select <T, U> (this ValueTask<T> self, Func<T, U> map) Source #

Standard LINQ Select implementation for Task

method ValueTask<T> Where <T> (this ValueTask<T> self, Func<T, bool> pred) Source #

Standard LINQ Where implementation for Task

method ValueTask<U> SelectMany <T, U> (this ValueTask<T> self, Func<T, ValueTask<U>> bind) Source #

Standard LINQ SelectMany implementation for Task

method ValueTask<V> SelectMany <T, U, V> (this ValueTask<T> self, Func<T, ValueTask<U>> bind, Func<T, U, V> project) Source #

Standard LINQ SelectMany implementation for Task

method ValueTask<int> Count <T> (this ValueTask<T> self) Source #

Get the Count of a Task T. Returns either 1 or 0 if cancelled or faulted.

method ValueTask<U> Bind <T, U> (this ValueTask<T> self, Func<T, ValueTask<U>> bind) Source #

Monadic bind operation for Task

method ValueTask<bool> Exists <T> (this ValueTask<T> self, Func<T, bool> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<bool> ExistsAsync <T> (this ValueTask<T> self, Func<T, ValueTask<bool>> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<bool> ForAll <T> (this ValueTask<T> self, Func<T, bool> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<bool> ForAllAsync <T> (this ValueTask<T> self, Func<T, ValueTask<bool>> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<T> Filter <T> (this ValueTask<T> self, Func<T, bool> pred) Source #

Filters the task. This throws a BottomException when pred(Result) returns false

method ValueTask<S> Fold <T, S> (this ValueTask<T> self, S state, Func<S, T, S> folder) Source #

Folds the Task. Returns folder(state,Result) if not faulted or cancelled. Returns state otherwise.

method ValueTask<S> FoldAsync <T, S> (this ValueTask<T> self, S state, Func<S, T, ValueTask<S>> folder) Source #

Folds the Task. Returns folder(state,Result) if not faulted or cancelled. Returns state otherwise.

method ValueTask<Unit> Iter <T> (this ValueTask<T> self, Action<T> f) Source #

Iterates the Task. Invokes f(Result) if not faulted or cancelled

method ValueTask<A> Do <A> (this ValueTask<A> ma, Action<A> f) Source #

Impure iteration of the bound value in the structure

Parameters

returns

Returns the original unmodified structure

method ValueTask<U> Map <T, U> (this ValueTask<T> self, Func<T, U> map) Source #

Returns map(Result) if not faulted or cancelled.

method ValueTask<U> MapAsync <T, U> (this ValueTask<T> self, Func<T, ValueTask<U>> map) Source #

Returns map(Result) if not faulted or cancelled.

method ValueTask<V> Join <T, U, K, V> (this ValueTask<T> source, ValueTask<U> inner, Func<T, K> outerKeyMap, Func<U, K> innerKeyMap, Func<T, U, V> project) Source #

method ValueTask<V> GroupJoin <T, U, K, V> (this ValueTask<T> source, ValueTask<U> inner, Func<T, K> outerKeyMap, Func<U, K> innerKeyMap, Func<T, ValueTask<U>, V> project) Source #

method ValueTask<A> Plus <A> (this ValueTask<A> ma, ValueTask<A> mb) Source #

method ValueTask<A> PlusFirst <A> (this ValueTask<A> ma, ValueTask<A> mb) Source #

method ValueTask<A> Cast <A> (this ValueTask source) Source #

method ValueTask<Unit> ToUnit (this ValueTask source) Source #

method ValueTask<Unit> WindowIter <A> (this IEnumerable<ValueTask<A>> ma, Action<A> f) Source #

Tasks a lazy sequence of tasks and iterates them in a 'measured way'. A default window size of Sys.DefaultAsyncSequenceConcurrency tasks is used, which by default means there are Sys.DefaultAsyncSequenceConcurrency / 2 'await streams'. An await stream essentially awaits one task from the sequence, and on completion goes and gets the next task from the lazy sequence and awaits that too. This continues until the end of the lazy sequence, or forever for infinite streams.

method ValueTask<Unit> WindowIter <A> (this IEnumerable<ValueTask<A>> ma, int windowSize, Action<A> f) Source #

Tasks a lazy sequence of tasks and iterates them in a 'measured way'. A default window size of windowSize tasks is used, which means there are windowSize 'await streams'. An await stream essentially awaits one task from the sequence, and on completion goes and gets the next task from the lazy sequence and awaits that too. This continues until the end of the lazy sequence, or forever for infinite streams. Therefore there are at most windowSize tasks running concurrently.

class Prelude Source #

Methods

method ValueTask<A> ValueTaskSucc <A> (A self) Source #

Convert a value to a Task that completes immediately

method ValueTask<A> ValueTaskFail <A> (Exception ex) Source #

Convert a value to a Task that completes immediately

method ValueTask<A> flatten <A> (ValueTask<ValueTask<A>> self) Source #

Flatten the nested Task type

method ValueTask<A> flatten <A> (ValueTask<ValueTask<ValueTask<A>>> self) Source #

Flatten the nested Task type

method ValueTask<int> count <A> (ValueTask<A> self) Source #

Get the Count of a Task T. Returns either 1 or 0 if cancelled or faulted.

method ValueTask<B> bind <A, B> (ValueTask<A> self, Func<A, ValueTask<B>> bind) Source #

Monadic bind operation for Task

method ValueTask<bool> exists <A> (ValueTask<A> self, Func<A, bool> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<bool> existsAsync <A> (ValueTask<A> self, Func<A, ValueTask<bool>> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<bool> forall <A> (ValueTask<A> self, Func<A, bool> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<bool> forallAsync <A> (ValueTask<A> self, Func<A, ValueTask<bool>> pred) Source #

Returns false if the Task is cancelled or faulted, otherwise it returns the result of pred(Result)

method ValueTask<A> filter <A> (ValueTask<A> self, Func<A, bool> pred) Source #

Filters the task. This throws a BottomException when pred(Result) returns false

method ValueTask<Unit> iter <A> (ValueTask<A> self, Action<A> f) Source #

Iterates the Task. Invokes f(Result) if not faulted or cancelled

method ValueTask<B> map <A, B> (ValueTask<A> self, Func<A, B> map) Source #

Returns map(Result) if not faulted or cancelled.

method ValueTask<B> mapAsync <A, B> (ValueTask<A> self, Func<A, ValueTask<B>> map) Source #

Returns map(Result) if not faulted or cancelled.

method ValueTask<A> plus <A> (this ValueTask<A> ma, ValueTask<A> mb) Source #

method ValueTask<A> plusFirst <A> (this ValueTask<A> ma, ValueTask<A> mb) Source #

method ValueTask<A> choice <A> (ValueTask<A> ma, params ValueTask<A>[] tail) Source #

Returns the first successful computation

Parameters

type A

Bound value

param ma

The first computation to run

param tail

The rest of the computations to run

returns

The first computation that succeeds

method ValueTask<A> choice <A> (Seq<ValueTask<A>> xs) Source #

Returns the first successful computation

Parameters

type A

Bound value

param xs

Sequence of computations to run

returns

The first computation that succeeds

method ValueTask<B> apply <A, B> (ValueTask<Func<A, B>> fab, ValueTask<A> fa) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative to apply

returns

Applicative of type FB derived from Applicative of B

method ValueTask<B> apply <A, B> (Func<A, B> fab, ValueTask<A> fa) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative to apply

returns

Applicative of type FB derived from Applicative of B

method ValueTask<C> apply <A, B, C> (ValueTask<Func<A, B, C>> fabc, ValueTask<A> fa, ValueTask<B> fb) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative a to apply

param fb

Applicative b to apply

returns

Applicative of type FC derived from Applicative of C

method ValueTask<C> apply <A, B, C> (Func<A, B, C> fabc, ValueTask<A> fa, ValueTask<B> fb) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative a to apply

param fb

Applicative b to apply

returns

Applicative of type FC derived from Applicative of C

method ValueTask<Func<B, C>> apply <A, B, C> (ValueTask<Func<A, B, C>> fabc, ValueTask<A> fa) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative to apply

returns

Applicative of type f(b -> c) derived from Applicative of Func<B, C>

method ValueTask<Func<B, C>> apply <A, B, C> (Func<A, B, C> fabc, ValueTask<A> fa) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative to apply

returns

Applicative of type f(b -> c) derived from Applicative of Func<B, C>

method ValueTask<Func<B, C>> apply <A, B, C> (ValueTask<Func<A, Func<B, C>>> fabc, ValueTask<A> fa) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative to apply

returns

Applicative of type f(b -> c) derived from Applicative of Func<B, C>

method ValueTask<Func<B, C>> apply <A, B, C> (Func<A, Func<B, C>> fabc, ValueTask<A> fa) Source #

Apply

Parameters

param fab

Function to apply the applicative to

param fa

Applicative to apply

returns

Applicative of type f(b -> c) derived from Applicative of Func<B, C>